<?php $month ='';?>
<?php foreach ($profit->result() as $key => $val ): ?>
    <li>
        <?php if (substr($val->created_at,0,7) != $month) : ?>
            <div class="list-time">
                <?php $month = substr($val->created_at,0,7); ?>
                <?php echo substr($val->created_at,0,10); ?>
            </div>
        <?php endif; ?>
        <div class="usermsg-box">
            <div class="usermsg flex">
                <div class="user flex-1"><?php echo $val->user_name;?></div>
                <div class="ordertime flex-1"><?php echo substr($val->created_at,0,16);?> &nbsp;下单</div>
            </div>
            <div class="title am-cf">
                <div class="name"><?php echo $val->goods_name;?></div>
    <!--            <div class="type2">--><?php //"商品"; ?><!--</div>-->
                <div class="price">￥<?php echo $val->shop_price;?></div>
            </div>
            <div class="tradstate am-cf">
                <span class="trad-num">
                    <?php if ($val->status == 2): ?>
                        <?php echo $val->refund_num;?>
                    <?php else:?>
                        <?php echo $val->number;?>
                    <?php endif ?>
                    份
                </span>
            </div>
            <div class="orderprice">订单金额：￥
                <?php if ($val->status == 2): ?>
                    <?php echo bcmul($val->shop_price, $val->refund_num, 2);?>
                <?php else:?>
                    <?php echo bcmul($val->shop_price, $val->number, 2);?>
                <?php endif ?>
            </div>
            <div class="fprice">
                <?php if ($val->order_status == 6): ?>
                    <span class="hasprice am-fl">已到账</span>
                <?php else:?>
                    <span class="notprice am-fl">未到账</span>
                <?php endif ?>
                <span>分润金额：</span>
                <span>
                    <?php if ($val->status == 2 && $val->refund_num ==0): ?>
                        <span class="hasprice">￥0.00</span>
                    <?php else:?>
                        <span <?php if ($val->order_status == 6): ?>class="hasprice"<?php else:?>class="notprice"<?php endif ?> >
                            ￥<?php echo $val->account;?>
                        </span>
                    <?php endif ?>
                </span>
            </div>
        </div>
    </li>
<?php endforeach ?>
